home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -in_the_mag- / workbench / adf / adflib / adflib.lha / Lib / adflib.h < prev    next >
C/C++ Source or Header  |  1999-05-23  |  3KB  |  102 lines

  1. #ifndef ADFLIB_H
  2. #define ADFLIB_H 1
  3.  
  4. /*
  5.  *  ADF Library. (C) 1997-1998 Laurent Clevy
  6.  *
  7.  * adflib.h
  8.  *
  9.  * include file
  10.  */
  11.  
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif /* __cplusplus */
  15.  
  16.  
  17. /* Visual C++ DLL specific, define  WIN32DLL or not in the makefile */
  18.  
  19. #ifdef WIN32DLL
  20. #define PREFIX __declspec(dllimport)
  21. #else
  22. #define PREFIX 
  23. #endif /* WIN32DLL */
  24.  
  25. #include "adf_defs.h"
  26. #include "adf_str.h"
  27.  
  28. /* util */
  29. PREFIX void freeList(struct List* list);
  30.  
  31. /* dir */
  32. PREFIX RETCODE adfCreateDir(struct Volume* vol, SECTNUM parent, char* name);
  33. PREFIX RETCODE adfChangeDir(struct Volume* vol, char *name);
  34. PREFIX RETCODE adfParentDir(struct Volume* vol);
  35. PREFIX RETCODE adfRemoveEntry(struct Volume *vol, SECTNUM pSect, char *name);
  36. PREFIX struct List* adfGetDirEnt(struct Volume* vol, SECTNUM nSect );
  37. PREFIX struct List* adfGetRDirEnt(struct Volume* vol, SECTNUM nSect, BOOL recurs );
  38. PREFIX void printEntry(struct Entry* entry);
  39. PREFIX void adfFreeDirList(struct List* list);
  40. PREFIX void adfFreeEntry(struct Entry *);
  41. PREFIX RETCODE adfRenameEntry(struct Volume *vol, SECTNUM, char *old,SECTNUM,char *new);
  42. PREFIX RETCODE adfSetEntryAccess(struct Volume*, SECTNUM, char*, long);
  43. PREFIX RETCODE adfSetEntryComment(struct Volume*, SECTNUM, char*, char*);
  44.  
  45. /* file */
  46. PREFIX long adfFileRealSize(unsigned long size, int blockSize, long *dataN, long *extN);
  47. PREFIX struct File* adfOpenFile(struct Volume *vol, char* name, char *mode);
  48. PREFIX void adfCloseFile(struct File *file);
  49. PREFIX long adfReadFile(struct File* file, long n, unsigned char *buffer);
  50. PREFIX BOOL adfEndOfFile(struct File* file);
  51. PREFIX long adfWriteFile(struct File *file, long n, unsigned char *buffer);
  52. PREFIX void adfFlushFile(struct File *file);
  53.  
  54. /* volume */
  55. PREFIX RETCODE adfInstallBootBlock(struct Volume *vol,unsigned char*);
  56. PREFIX struct Volume* adfMount( struct Device *dev, int nPart, BOOL readOnly );
  57. PREFIX void adfUnMount(struct Volume *vol);
  58. PREFIX void adfVolumeInfo(struct Volume *vol);
  59.  
  60. /* device */
  61. PREFIX void adfDeviceInfo(struct Device *dev);
  62. PREFIX struct Device* adfMountDev( char* filename);
  63. PREFIX void adfUnMountDev( struct Device* dev);
  64. PREFIX RETCODE adfCreateHd(struct Device* dev, int n, struct Partition** partList );
  65. PREFIX RETCODE adfCreateFlop(struct Device* dev, char* volName, int volType );
  66. PREFIX RETCODE adfCreateHdFile(struct Device* dev, char* volName, int volType);
  67.  
  68. /* dump device */
  69. PREFIX struct Device* adfCreateDumpDevice(char* filename, long cyl, long heads, long sec);
  70.  
  71. /* env */
  72. PREFIX void adfEnvInitDefault();
  73. PREFIX void adfEnvCleanUp();
  74. PREFIX void adfChgEnvProp(int prop, void *new);
  75. PREFIX char* adfGetVersionNumber();
  76. PREFIX char* adfGetVersionDate();
  77. /* obsolete */
  78. PREFIX void adfSetEnvFct( void(*e)(char*), void(*w)(char*), void(*v)(char*) );
  79.  
  80. /* link */
  81. PREFIX RETCODE adfBlockPtr2EntryName(struct Volume *, SECTNUM, SECTNUM,char **, long *);
  82.  
  83.  
  84. /* middle level API */
  85.  
  86. PREFIX BOOL isSectNumValid(struct Volume *vol, SECTNUM nSect);
  87.  
  88.  
  89. /* low level API */
  90.  
  91. PREFIX RETCODE adfReadBlock(struct Volume* , long nSect, unsigned char* buf);
  92. PREFIX RETCODE adfWriteBlock(struct Volume* , long nSect, unsigned char* buf);
  93. PREFIX long adfCountFreeBlocks(struct Volume* vol);
  94.  
  95.  
  96. #ifdef __cplusplus
  97. }
  98. #endif
  99.  
  100. #endif /* ADFLIB_H */
  101. /*##########################################################################*/
  102.